//
//  BIDMoreModuleViewController.m
//  HJGJCommunity
//
//  Created by mal on 2017/6/29.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDMoreModuleViewController.h"
#import "UICollectionView+BIDHaveEmptyData.h"
#import "BIDFunctionSubCell.h"

@interface BIDMoreModuleViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
{
    NSArray *_dataSourceArr;
}
@end

@implementation BIDMoreModuleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"更多功能";
    _dataSourceArr = @[];
    CGSize screenSize = [UIScreen mainScreen].bounds.size;
    [_collectionView registerClass:[BIDFunctionSubCell class] forCellWithReuseIdentifier:@"identifier"];
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
    [flowLayout setItemSize:CGSizeMake(screenSize.width/4, 65.f)];
    [flowLayout setMinimumLineSpacing:10];
    [flowLayout setMinimumInteritemSpacing:0];
    [flowLayout setSectionInset:UIEdgeInsetsMake(13.f, 0.f, 0.f, 0.f)];
    [_collectionView setCollectionViewLayout:flowLayout];
    _collectionView.pagingEnabled = YES;
    _collectionView.bounces = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    [_collectionView showEmptyView];
}

#pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _dataSourceArr.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell = nil;
    NSUInteger row = indexPath.row;
    BIDFunctionSubCell *headerCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath];
    NSDictionary *dic = _dataSourceArr[row];
    cell = headerCell;
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%ld", indexPath.row);
    NSUInteger row = indexPath.row;
    NSDictionary *dic = _dataSourceArr[row];
}

@end
